import qs from 'qs';
import request from '@/utils/request';
import func from '@/utils/Func';
const { NODE_ENV } = process.env;

var prefix=""
if(NODE_ENV=='development'){
  prefix='/api'
}else{
  prefix='http://192.168.0.110:8080'
}



// 登录方法
export async function login({ payload }) {
  return request(prefix+'/login', {
    method: 'POST',
    body: JSON.stringify(payload),
  });
}

// 获取用户详细信息
export function getInfo() {
  return request({
    url: '/getInfo',
    method: 'get',
  });
}

// 退出方法
export function logout() {
  return request({
    url: '/logout',
    method: 'post',
  });
}

export async function getCodeImg() {
  return request(prefix+'/captchaImage');
}
